#pragma once

#include<iostream>
#include<string>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
//公共文件这样的名称
const std::string pipefile = "./fifo";
const mode_t gmode = 0600;
const int gsize = 1024;
const int W = O_WRONLY;
const int R = O_RDONLY;

int coomopen(int fk)
{
    int fp = open(pipefile.c_str(),fk);//打开文件
    if(fp < 0)
    {
        std::cerr << "打开文件失败" << std::endl;
    }
    std::cout << "打开文件成功" << std::endl;
    return fp;
}

void commclose(int fp)
{
    if(fp > 0) ::close(fp);
}